#!/usr/bin/php -q
<?php

$NB_TASKS = 20000;
$SUBMIT_DELTA_MIN = 1;
$SUMBIT_DELTA_MAX = 100;

$DIFF_RUNTIME_PERCENT_MAX = 40;

$REQUEST_TIME_MIN = 200;
$REQUEST_TIME_MAX = 200000;

$NB_REQUESTED_PROC_MIN = 30;
$NB_REQUESTED_PROC_MAX = 90;

$OUTPUT = "monTestDe20000Taches.wld";

$fichier = fopen($OUTPUT, "w");

$submitTimePred = 0;
for ($i = 1; $i <= $NB_TASKS; $i++) {
	
	//$task = "task$i";
	$submitTime = $submitTimePred + rand($SUBMIT_DELTA_MIN, $SUMBIT_DELTA_MAX);
	$requestedTime = rand($REQUEST_TIME_MIN, $REQUEST_TIME_MAX);
	$runtime = round((1.0 - rand(1, $DIFF_RUNTIME_PERCENT_MAX) / 100.0) * $requestedTime);
	$nbProcs = rand($NB_REQUESTED_PROC_MIN, $NB_REQUESTED_PROC_MAX);
	$inputSize = 0;
	$outputSize = 0;
	$priority = 0;
	
	$ligne = "$submitTime    $runtime    $inputSize    $outputSize    $requestedTime    $nbProcs    $priority". ($i == $NB_TASKS ? "" : "\n");
	echo $ligne;
	
	fprintf($fichier, $ligne);
	
	
	$submitTimePred = $submitTime;
}

fclose($fichier);

?>
